﻿using System;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using System.Configuration;
using DropBoxClient.Entities;

namespace DropBoxClient.Tests
{
    [TestClass]
    public class GetAccountInfoTest
    {
        private string accessToken;
        private AccountInfo accountInfo;

        [TestInitialize]
        public void Init()
        {
            accessToken = ConfigurationManager.AppSettings["AccessToken"];
            var client = new OAuth2Client(accessToken);
            accountInfo = client.GetAccountInfo();
        }

        [TestMethod]
        public void GetAccountInfo_ResultIsNotNull()
        {
            Assert.IsNotNull(accountInfo);
        }

        [TestMethod]
        public void GetAccountInfo_QuotaIsNotNull()
        {
            Assert.IsNotNull(accountInfo.QuotaInfo);
        }

        [TestMethod]
        public void GetAccountInfo_DisplayNameIsCorrect()
        {
            Assert.AreEqual("Vijay Thirugnanam", accountInfo.DisplayName);
        }
    }
}
